English
Configure Technitium DNS
Technitium is a DNS and DHCP server that runs from a Docker container. We will configure the Technitium DNS Docker stack; we will configure the firewall to allow the necessary ports; and we will bring the stack up through Arcane. Since the DNS will run inside the server, we need to assign the server a static IP on the local network. We will configure the server to not use DHCP and assign itself an IP on the network. The stack consists of the following containers:
- Technitium: DNS and DHCP server.
Steps
- Run:
./scripts/create_technitium_folder.shto generate the container directory on the SSD. - Edit the stack file:
nano ./files/technitium-stack.yml. - Replace
TZ=America/New_Yorkwith your system time zone. You can use this list as a reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. - Set the attribute
ipv4_addressin thetechnitiumcontainer with an IP in the non-assignable range of the DHCP. For example 192.168.1.10. - Copy all contents of the file to the clipboard. Save and exit with
Ctrl + X, Y, Enter. - Run:
./scripts/dns_firewalld_services.sh. Configure Firewalld for containers. The script opens the port for DNS for Technitium. - Add stack in Arcane from the browser.
- Access Arcane through https://server.lan:3552.
- Click "Projects" on the left menu and create a new Project.
- Name it "technitium" and paste the content of the docker-compose.yml that you copied to the clipboard and create the stack. From now on, modifications to the stack must be made through Arcane and not in the file.
- Run:
./scripts/disable_resolved.sh. We disable the local DNS service "systemd-resolved" to free up the DNS port that Technitium needs. - Look for the name of the active physical network device, for example
enp1s0oreth0:nmcli device status. If there is more than one physical device, select the one that is connected to the router with the best speed. Replaceenp1s0in the following commands with the correct device. - Assign static IP and CIDR range:
nmcli con mod enp1s0 ipv4.addresses 192.168.1.253/24. Typically home routers use a CIDR range of/24or its equivalent subnet mask255.255.255.0. Check your router's manual for more information. - Disable DHCP client:
nmcli con mod enp1s0 ipv4.method manual. - Configure the router IP:
nmcli con mod enp1s0 ipv4.gateway 192.168.1.254. Normally the router assigns itself a static IP which is the second to last IP in the IP range. - Configure Technitium as DNS and Cloudflare as fallback DNS:
nmcli con mod enp1s0 ipv4.dns "192.168.1.10 1.1.1.1". If you like to use another DNS like Google's, you can change it. - Reactivate the device for the changes to take effect:
nmcli con up enp1s0. This may terminate the SSH session. if so,sshto the server again. - Access Technitium through https://192.168.1.10/.
- Create an admin user and a password. It is again recommended to use Bitwarden for the same.
- Navigate to
Settingstab. - In the
Generaltab, make sure theEnable DNSSEC Validationfield is enabled. - Navigate to
Web Servicetab and enable theEnable HTTP to HTTPS Redirectionoption. The rest of the options should have been configured in thetechnitium-stack.yml. - Navigate to
Blockingtab and configure.- Select
ANY Addressfor theBlocking Typeoption. - Add blocklist addresses to the
Allow/Block List URLslist. Some recommendations of pages where you can get lists: https://easylist.to/ and https://firebog.net/.
- Select
- Navigate to
Proxy & Forwarderstab and selectCloudflare (DNS-over-HTTPS). It should add to theForwarderslist and selectDNS-over-HTTPSas theForwarder Protocol. If you wish to use a different provider or protocol you can select or configure a different one here. - Navigate to
Zonestab and configure:- Click the
Àdd Zonebutton. Zone:lan.- Click the
Addbutton. - Click the
Add Recordbutton. Name:server. This will configure our server in ourlandomain since our server has static IP and doesn't use DHCP.IPv4 Address:192.168.1.253. Use the static IP you assigned to your server.- Click the
Add Recordbutton. Name:homeassistant. This will configure Home Assistant in ourlandomain with a static IP since it won't use DHCP. We have not created Home Assistant service yet, but it will have its IP ready.IPv4 Address:192.168.1.11. Use the static IP you assigned to Home Assistant inhome-assistant-stack.yml.- Click the
Add Recordbutton. Name:technitium. This will configure Technitium in ourlandomain since it doesn't add itself.IPv4 Address:192.168.1.10. Use the static IP you assigned to Technitium intechnitium-stack.yml.- Click the
Backbutton. - If you are not going to expose you server to the internet, you can skip the rest of this step.
- Click the
Àdd Zonebutton. Zone:myhome.duckdns.org. Use the subdomain you registered in DuckDNS.org.- Click the
Addbutton. - Click the
Add Recordbutton. Name:@. This will configure the root subdomain to point to our server.IPv4 Address:192.168.1.253. Use the static IP you assigned to your server.- Click the
Add Recordbutton. Name:*. This will configure a wildcard subdomain to point to our server.IPv4 Address:192.168.1.253. Use the static IP you assigned to your server.- Click the
Backbutton.
- Click the
- If any page is being blocked and you do not want to block it, Navigate to
Allowedtab and add the domain to the list.
Depending on your hardware the DHCP will be configured differently. Please select the option that matches your situation. If you have control over the DNS that your router's DHCP provides, select Configure router DHCP. Otherwise, select Configure Technitium DHCP.